/*
 * @Author: wuwk
 * @Date: 2021-12-16 13:25:57
 * @LastEditors: wuwk
 * @LastEditTime: 2021-12-16 13:34:42
 * @Description: 
 */
import request from '../utils/requset';
import jrsbqg from './pageApi/jrsbqg';

const APIS = {
  // eg
  getBsecodeNumType: {
    method: 'GET',
    url: `/web/common/basecode/vn/CS_GY_ZSFZJLX`,
  },
  ...jrsbqg
}

const methods = {};

/* eslint-disable */
for (const method in APIS) {
  if (APIS.hasOwnProperty(method)) {
    const requestMethod = APIS[method].method ? APIS[method].method.toLowerCase() : 'get';
    methods[method] = ((reqMethod, url, opts) => {
      opts.name = method;
      const optss = opts;
      return (data, options) => request[reqMethod]({
        url: `${url}`,
        data,
        opts: {
          name: method,
          ...Object.assign(options || {}, optss || {}),
        },
      });
    })(requestMethod, APIS[method].url, APIS[method]);
  }
}

export default methods;